﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FangDuShi_Admin.BLL
{
    public class Common
    {
        private readonly DAL.Common dal = new DAL.Common();
        public int GetRecordCount(string table, string strWhere)
        {
            return dal.GetRecordCount(table, strWhere);
        }
        /// <summary>
        /// 分页获取数据

        /// <date>2013-09-06</date>
        /// </summary>       
        /// <param name="tableName">表名</param>
        /// <param name="fields">字段名(全部字段为*)</param>
        /// <param name="pageSize">每页显示多少条记录</param>
        /// <param name="pageIndex">指定当前为第几页 </param>
        /// <param name="strWhere">条件语句(不用加where) </param>
        /// <param name="fOrderFiled">排序字段(必须!支持多字段)  </param>
        /// <param name="orderType">排序方式，非0则降序</param>
        /// <param name="total">返回总记录数</param>
        /// <returns>返回所取ds</returns>
        public DataSet GetListByPage(string tableName, string fieldskey, int pageSize, int pageIndex, string strWhere, string fOrderFiled, out int total, string FieldShow = "*")
        {
            return dal.GetListByPage(tableName, fieldskey, pageSize, pageIndex, strWhere, fOrderFiled, out total, FieldShow);
        }
    }
}
